//
// Table
// --------------------------------------------------


@thead-bg: #efefef;
@thead-bg-dark: #a7a7a7;
@table-bg-hover: #f2f2f2;
@table-bg-accent: #fafafa;
@table-border-color: @border-color-base;
@table-cell-padding: 10px 12px;
@table-condensed-cell-padding: 6px 10px;


caption {
    padding: 10px 0;
}

.table {
    width: 100%;
    max-width: 100%;
    background-color: #fff;

    > thead {
        background-color: @thead-bg;
        border-bottom: 1px solid @table-border-color;

        &.light {
            background-color: transparent;
        }
        &.dark {
            background-color: @thead-bg-dark;
        }
    }

    tr {
        transition: background-color 400ms;

        &:first-child {
            > th,
            > td {
                border-top: 0;
            }
        }
    }

    th,
    td {
        padding: @table-cell-padding;
        text-align: left;
        color: @text-color-base;
        border-top: 1px solid @table-border-color;


    }

    th {
        padding: 6px 12px;
        font-weight: 400;
        color: @text-color-light;
    }

    > thead.dark th {
        color: #fff;
    }
}

.table tr,
.table td {
    &.success {
        background-color: @state-success-bg !important;
        color: @state-success-color !important;
    }
    &.warning {
        background-color: @state-warning-bg !important;
        color: @state-warning-color !important;
    }
    &.error {
        background-color: @state-danger-bg !important;
        color: @state-danger-color !important;
    }
}

.table-bordered {
    border: 1px solid @table-border-color;

    th,
    td {
        border: 1px solid @table-border-color;
    }
}

.table-bordered-single {
    border: 1px solid @table-border-color;
}

.table-hover {
    > tbody > tr:hover {
        background-color: @table-bg-hover;
    }
}

.table-stripped {
    > tbody > tr:nth-child(even) {
        background-color: @table-bg-accent;
    }
}

.table-condensed {
    th, 
    td {
        padding: @table-condensed-cell-padding;
    }
}